package com.drug.mingkang.model.vo;

import cn.hutool.http.HtmlUtil;
import com.drug.mingkang.utils.Tools;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import org.springframework.util.StringUtils;

import java.io.Serializable;
import java.util.Date;

/**
 * 描述：原材料采购管理
 * 所属项目：mingkang
 *
 * @author 依旧
 * @create 2020-08-13 09:58
 * @employ IntelliJ IDEA
 * @since 1.0.0
 */
@Data
public class PurchaseorderVo implements Serializable {
    @ApiParam(name = "page", value = "页", required = true)
    private int page;

    public int getPage() {
        return (page-1)*limit;
    }
    @ApiParam(name = "limit", value = "行", required = true)
    private int limit;

    /**
     * 采购订单Id
     */
    private String purchaseId;

    /**
     * 供应商名称
     */
    private String supName;

    public String getSupName() {
        return HtmlUtil.escape(supName);
    }

    /**
     * 采购人
     */
    private String purchasePerson;
    /**
     * 采购时间
     */
    private Date purchaseTime;
    /**
     * 操作时间
     */
    private Date opTime;
    /**
     * 采购总金额
     */
    private Double purchaseSumprice;
    /**
     * 数量
     */
    private Integer count;

    public Integer getCount() {
        if (StringUtils.isEmpty(count)){
            return 0;
        }
        return count;
    }
    /**
     * 开始时间
     */
    private String startTime;

    public String getStartTime() {
        if (!StringUtils.isEmpty(startTime)){
            return startTime+ " 00:00:00";
        }
        return startTime;
    }

    public String getOverTime() {
        if (!StringUtils.isEmpty(overTime)){
            return overTime+ " 23:59:59";
        }
        return overTime;
    }

    /**
     * 结束时间
     */
    private String overTime;
    /**
     * 审核状态
     */
    private String reviewState;
    /**
     * 备注
     */
    private String remark;

    public String getRemark() {
        return HtmlUtil.escape(remark);
    }

    /**
     * 入库状态
     */
    private Integer state;

    /**
     * 状态
     */
    private String isva;

}